<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Carbon\Carbon;

class CmTypeSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $types = [
            // 数学类别 (科目ID: 1)
            ['type_name' => '代数', 's_id' => '1'],
            ['type_name' => '几何', 's_id' => '1'],
            ['type_name' => '微积分', 's_id' => '1'],
            ['type_name' => '概率统计', 's_id' => '1'],
            
            // 语文类别 (科目ID: 2)
            ['type_name' => '现代文阅读', 's_id' => '2'],
            ['type_name' => '古诗词', 's_id' => '2'],
            ['type_name' => '文言文', 's_id' => '2'],
            ['type_name' => '作文', 's_id' => '2'],
            
            // 英语类别 (科目ID: 3)
            ['type_name' => '语法', 's_id' => '3'],
            ['type_name' => '词汇', 's_id' => '3'],
            ['type_name' => '阅读理解', 's_id' => '3'],
            ['type_name' => '写作', 's_id' => '3'],
            
            // 物理类别 (科目ID: 4)
            ['type_name' => '力学', 's_id' => '4'],
            ['type_name' => '电磁学', 's_id' => '4'],
            ['type_name' => '光学', 's_id' => '4'],
            ['type_name' => '热学', 's_id' => '4'],
            
            // 化学类别 (科目ID: 5)
            ['type_name' => '无机化学', 's_id' => '5'],
            ['type_name' => '有机化学', 's_id' => '5'],
            ['type_name' => '物理化学', 's_id' => '5'],
            ['type_name' => '分析化学', 's_id' => '5'],
            
            // 计算机科学类别 (科目ID: 10)
            ['type_name' => '编程基础', 's_id' => '10'],
            ['type_name' => '数据结构', 's_id' => '10'],
            ['type_name' => '算法', 's_id' => '10'],
            ['type_name' => '数据库', 's_id' => '10'],
        ];

        foreach ($types as $type) {
            DB::table('cm_type')->insert([
                'type_name' => $type['type_name'],
                's_id' => $type['s_id'],
                'created_at' => Carbon::now(),
                'updated_at' => Carbon::now(),
            ]);
        }
    }
}